#-*- coding: utf-8 -*-
#coding:utf-8
#保存处理结果
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

from sys import argv
script,taskId,server,usedTimes,result,deviceNum=argv
print(argv)

import mysql.connector
conn=mysql.connector.connect(user='root',password='',host='127.0.0.1',port='3306',database='recharge',charset='utf8')
cursor=conn.cursor();

sql="insert into selectServer(server,useTime,status,taskId,deviceNum) values(%s,%s,'%s',%s,'%s')"%(server,usedTimes,result,taskId,deviceNum)

cursor.execute(sql)
conn.commit()
conn.close()

if cmp(result,'find')!=0:
    import winsound
    winsound.Beep(600, 500)  # 其中600表示声音大小，1000表示发生时长，1000为1秒

print 'ok'



